]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
cleanup: Avoid pointless "renames" in destructuring
authorFlorian Müllner <fmuellner@gnome.org>
Thu, 12 Sep 2019 15:19:51 +0000 (17:19 +0200)
committerFlorian Müllner <fmuellner@gnome.org>
Sun, 15 Sep 2019 14:02:45 +0000 (16:02 +0200)
ES5 allows to rename variables in object destructuring, however this
only makes sense when we want to use a different name than the object
property.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/731

js/ui/extensionSystem.js
js/ui/notificationDaemon.js
js/ui/workspace.js

index e8f20794374198446c84f3a9ab927243c8f4290e..7c36d70903d636ce40c46f237d8a2b7e9c73e142 100644 (file)
@@ -286,7 +286,7 @@ var ExtensionManager = class {
     reloadExtension(oldExtension) {
         // Grab the things we'll need to pass to createExtensionObject
         // to reload it.
-        let { uuid: uuid, dir: dir, type: type } = oldExtension;
+        let { uuid, dir, type } = oldExtension;
 
         // Then unload the old extension.
         this.unloadExtension(oldExtension);
index ece95e790baaf1a78bb2777430d7642758efc6b7..aa65bf6c842fa85749b99de0cdff24f176b32838 100644 (file)
@@ -541,15 +541,15 @@ class GtkNotificationDaemonNotification extends MessageTray.Notification {
         super(source);
         this._serialized = GLib.Variant.new('a{sv}', notification);
 
-        let { "title": title,
-              "body": body,
-              "icon": gicon,
-              "urgent": urgent,
-              "priority": priority,
-              "buttons": buttons,
+        let { title,
+              body,
+              icon: gicon,
+              urgent,
+              priority,
+              buttons,
               "default-action": defaultAction,
               "default-action-target": defaultActionTarget,
-              "timestamp": time } = notification;
+              timestamp: time } = notification;
 
         if (priority) {
             let urgency = PRIORITY_URGENCY_MAP[priority.unpack()];
@@ -590,8 +590,8 @@ class GtkNotificationDaemonNotification extends MessageTray.Notification {
     }
 
     _onButtonClicked(button) {
-        let { 'action': action, 'target': actionTarget } = button;
-        this._activateAction(action.unpack(), actionTarget);
+        let { action, target } = button;
+        this._activateAction(action.unpack(), target);
     }
 
     activate() {
index d866e843f931436b5159c902d2a4051eb9005813..f09637b89bfc65003df1edde8779af9d6ddabb4d 100644 (file)
@@ -903,7 +903,7 @@ var LayoutStrategy = class {
     computeWindowSlots(layout, area) {
         this._computeRowSizes(layout);
 
-        let { rows: rows, scale: scale } = layout;
+        let { rows, scale } = layout;
 
         let slots = [];
 
@@ -978,7 +978,7 @@ var LayoutStrategy = class {
 
 var UnalignedLayoutStrategy = class extends LayoutStrategy {
     _computeRowSizes(layout) {
-        let { rows: rows, scale: scale } = layout;
+        let { rows, scale } = layout;
         for (let i = 0; i < rows.length; i++) {
             let row = rows[i];
             row.width = row.fullWidth * scale + (row.windows.length - 1) * this._columnSpacing;